﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MOCSoftware.Utilities.JpgMetaDataViewer.Model;
using MOCSoftware.Utilities.JpgMetaDataViewer.Utility;

namespace MOCSoftware.Utilities.JpgMetaDataViewer.Viewmodel
{
    internal class ImageViewModel : ViewModelBase
    {
        private string _source;
        private JpgManager _jpgManager;

        public ImageViewModel(JpgManager jpgManager)
        {
            _jpgManager = jpgManager;
            _jpgManager.FileLoadDialogueFileSelectedHandler += OnFileLoadDialogueFileSelected;
        }

        public string Source
        {
            get
            {
                return _source ?? string.Empty;
            }
            set
            {
                _source = value;
                OnPropertyChanged("Source");
            }
        }

        internal override void Initialise()
        {
        }

        private void OnFileLoadDialogueFileSelected(object source, FileLoadDialogueFileSelectedEventArgs e)
        {
            Source = e.FileName;
        }
    }
}
